package com.maidada.codesharebackend.exception;

import lombok.Getter;

/**
 * 自定义业务异常
 *
 * @author wulinxuan
 * @date 2025-06-24 11:33
 */
@Getter
public class BusinessException extends RuntimeException {

    private final int code;

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
    }

    public BusinessException(ErrorCode errorCode, String msg) {
        super(msg);
        this.code = errorCode.getCode();
    }
}
